package org.fer.source;

import android.app.Activity;
import android.os.Bundle;
import android.text.util.Linkify;
import android.view.View;
import android.widget.TextView;

public class ResponseActivity extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.response);

		Bundle bundle = getIntent().getExtras();

		TextView tvName = (TextView) this.findViewById(R.id.tvName);
		TextView tvAddress = (TextView) this.findViewById(R.id.tvAddress);
		TextView tvPhone = (TextView) this.findViewById(R.id.tvPhone);
		TextView tvBirth = (TextView) this.findViewById(R.id.tvBirth);

		tvPhone.setAutoLinkMask(Linkify.PHONE_NUMBERS);

		if ("".equals(bundle.getString(MainActivity.KEY_NAME))) {
			tvName.setVisibility(View.GONE);
		}
		if ("".equals(bundle.getString(MainActivity.KEY_ADDRESS))) {
			tvAddress.setVisibility(View.GONE);
		}
		if ("".equals(bundle.getString(MainActivity.KEY_PHONE))) {
			tvPhone.setVisibility(View.GONE);
		}
		if ("".equals(bundle.getString(MainActivity.KEY_BIRTH))) {
			tvBirth.setVisibility(View.GONE);
		}

		tvName.setText(bundle.getString(MainActivity.KEY_NAME));
		tvAddress.setText(bundle.getString(MainActivity.KEY_ADDRESS));
		tvPhone.setText(bundle.getString(MainActivity.KEY_PHONE));
		tvBirth.setText(bundle.getString(MainActivity.KEY_BIRTH));

	}

}
